﻿using UnityEngine;

public class Switch : ButtonBasic
{
    private void OnTriggerEnter2D(Collider2D collision)
    {
        foreach(GameObject item in charactors)
        {
            if (collision.gameObject.name == item.name)
            {
                state = !state;
                AfterSwitchChanged();
                return;
            }
        }
    }
}
